﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="/timefunction" prefix="tmf"%>
<jsp:include page="header.jsp"></jsp:include>
				<div id="content">
					<c:forEach items="${articles}" var="article">
						<div class="post" id="post-${article.id }">
							<div class="entrytop">
								<div class="entry">
									<h2>
										<a
											href="${pageContext.request.contextPath}/blog/${article.id}"
											rel="bookmark" title="Permanent Link to ${article.title }">${article.title
											}</a>
									</h2>
								</div>
							</div>

							<p class="postmeta">
							【${article.origin.name }】
							${tmf:getFormateTimeStr(' %Mc %De, %Y at %T12 %Nc',article.postTime) } |
								<a href="${pageContext.request.contextPath}/category/${article.category.id}" title="查看 未分类 的全部文章"
									rel="category">${article.category.name }</a> 
								<c:if test="${adminIsLogin!=null}">
									&#183;
								<a class="post-edit-link"
								href="${pageContext.request.contextPath}/admin/blogs/${article.id }/edit" title="编辑文章">编辑 </a>
								</c:if>
								<br />
								- Posted by
								<a href="">admin</a> |
								<a href="${pageContext.request.contextPath}/blog/${article.id }#comments"
									class="comments-link">${fn:length(article.comments)} Comment, Add Yours</a>
							</p>
			
							<div class="post-content">
								<c:set var="contLen" value="${fn:length(article.content)}"></c:set>
								<c:if test="${contLen>500}">
										${fn:substring(article.content,0,500)}
										</p>

									<span> &nbsp;&nbsp;...</span>


								</c:if>
								<c:if test="${contLen<=500}">
										${article.content}
									</c:if>
							</div>
						</div>

					</c:forEach>
				<!--  
					<!--  导航，未实现
					<div class="navigation">
						<span class="previous-entries"><a href="http://localhost/wordpress/" >上一页</a></span>
						<span class="next-entries"><a href="http://localhost/wordpress/" >下一页</a></span>
						
						
					</div>


					<c:if test="${fn:length(articles)<1}">
						<h2 class="center">
							博主很懒，还没发表日志
						</h2>
						<p class="center">
							对不起，博主还未发表日志。
						</p>
					</c:if>

				</div>
				<!--/content -->
				<!-- begin sidebar -->
			<jsp:include page="sidebar.jsp"></jsp:include>
			<!-- 底部 -->
			<jsp:include page="footer.jsp"></jsp:include>
			